#######################################################################################



require 'rubygems'
require 'watir-webdriver'
require 'rspec'
require 'data/my_patches/passed_failed_example.rb'
require 'data/configure_regression_suite/data_variables_for_regression_suite.rb'
Dir['data/ff_web-driver/*.rb'].each {|test| load test }
require 'win32ole'
require 'win32/process'
require 'fileutils'
require 'find'
require 'utils/save_file_ff.rb'
require 'utils/clean_process.rb'
require 'utils/close_all_browser_windows.rb'
require 'net/smtp'

# 'Start AutoIt
@@autoit = WIN32OLE.new("AutoItX3.Control")

# 'Close All Blueworks Live windows
begin
  close_all_browser_windows(@@autoit)
rescue
  bp_send_keys('','Enter')
  4.times {minor_wait}
  close_all_browser_windows(@@autoit)
end

if File.exists?('C:\Program Files\Mozilla Firefox 17\firefox.exe')
  Selenium::WebDriver::Firefox::Binary.path = 'C:\Program Files\Mozilla Firefox 17\firefox.exe'
elsif File.exists?('C:\Program Files\Mozilla Firefox 10\firefox.exe')
  Selenium::WebDriver::Firefox::Binary.path = 'C:\Program Files\Mozilla Firefox 10\firefox.exe'
elsif File.exists?('C:\Program Files (x86)\Mozilla Firefox 10\firefox.exe')
  Selenium::WebDriver::Firefox::Binary.path = 'C:\Program Files (x86)\Mozilla Firefox 10\firefox.exe'
elsif File.exists?('C:\Program Files (x86)\Mozilla Firefox\firefox.exe')
  Selenium::WebDriver::Firefox::Binary.path = 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'
elsif File.exists?('C:\Program Files\Mozilla Firefox\firefox.exe')
  Selenium::WebDriver::Firefox::Binary.path = 'C:\Program Files\Mozilla Firefox\firefox.exe'
end

# Create "screenshots" dir in the "\\results\date" dir
if File.directory?("#{$daily_results_path}\\screenshots") == false
 Dir.mkdir("#{$daily_results_path}\\screenshots")
end

# 'Start the Browser
$test_browser = Watir::Browser.new :firefox
$test_site = ""
$bp = $test_browser
$free_user = new_string()



# Load Screen-shots maker
require 'data/my_patches/screen_shots_maker.rb'

Process.create(
    :app_name       => 'ruby utils/pop_up_handler.rb',
    :creation_flags  => Process::DETACHED_PROCESS )

Process.create(
    :app_name       => 'ruby utils/pop_up_handler2.rb',
    :creation_flags  => Process::DETACHED_PROCESS )







